import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/workQuestion/page',
    method: 'get',
    params: query
  })
}

export function fetchQuestionList(query) {
  return request({
    url: '/workQuestion/list',
    method: 'get',
    params: query
  })
}

export function addQuestion(obj) {
  return request({
    url: '/workQuestion/addQuestion',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/workQuestion/' + id,
    method: 'get'
  })
}


export function addObj(obj) {
  return request({
    url: '/workQuestion',
    method: 'post',
    data: obj
  })
}

export function putObj(obj) {
  return request({
    url: '/workQuestion',
    method: 'put',
    data: obj
  })
}

export function delObj(id) {
  return request({
    url: '/workQuestion/' + id,
    method: 'delete'
  })
}

export function uploadQuestion(obj) {
  return request({
    url: '/workQuestion/upload',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    data: obj
  })
}
